1
general::
An agreement or compromise made through necessity, as in Since neither side won a majority, the coalition government was obviously a shotgun wedding. This expression alludes to a marriage precipitated by a woman's pregnancy, causing her father to point a literal or figurative gun at the responsible man's head. Its figurative use dates from the mid-1900s.
American Heritage Idioms
2
general::
Phrase(s): a shotgun wedding
Fig. a forced wedding. (From imagery of the bride’s father having threatened the bridegroom with a shotgun to force him to marry the bride because he made her pregnant.) • Mary was six months pregnant when she married Bill. It was a real shotgun wedding. • Bob would never have married Jane if she hadn’t been pregnant. Jane’s father saw to it that it was a shotgun wedding.
McGrawhill's American Idioms And Phrasal Verbs